package com.dzx.design.behavioral.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author dzx
 * @ClassName:
 * @Description:
 * @date 2019年08月14日 17:10:59
 */
public class Staff {

    private List<Command> commandList = new ArrayList<Command>();

    public void addCommand(Command command) {
        commandList.add(command);
    }

    public void executeCommand() {
        for (Command command: commandList) {
            command.execute();
        }
        commandList.clear();
    }


}
